<%@ page import="union.Organograma" %>

<h3>Dados de organograma</h3>

<div class="row-fluid">
<div class="span4 ${hasErrors(bean: organogramaInstance, field: 'descricao', 'error')} ">
	<label for="descricao">
		<g:message code="organograma.descricao.label" default="Descricao" />
		
	</label>
	<g:textField name="descricao" value="${organogramaInstance?.descricao}"/>
</div>
<div class="span4 ${hasErrors(bean: organogramaInstance, field: 'organizacao', 'error')} required">
	<label for="organizacao">
		<g:message code="organograma.organizacao.label" default="Organizacao" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="organizacao" name="organizacao.id" from="${union.Organizacao.list()}" optionKey="id" required="" value="${organogramaInstance?.organizacao?.id}" class="many-to-one"/>
</div>

</div>

<div class="fieldcontain ${hasErrors(bean: organogramaInstance, field: 'areasOrganograma', 'error')} ">
	<label for="areasOrganograma">
		<g:message code="organograma.areasOrganograma.label" default="Areas Organograma" />		
	</label>	
	<ul class="one-to-many">
		<g:each in="${organogramaInstance?.areasOrganograma?}" var="a">
		    <li><g:link controller="areasOrganograma" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
		</g:each>
		<li class="add">
			<g:link controller="areasOrganograma" action="create" params="['organograma.id': organogramaInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'areasOrganograma.label', default: 'AreasOrganograma')])}</g:link>
		</li>
	</ul>
</div>


